package creational.singleton;

/**
 * 单例模式：多线程
 * @author Zhang Ziyi
 */
public class SingletonThread {
    private static SingletonThread singletonThread;

    private SingletonThread() {
    }

    public static SingletonThread getInstance() {
        if (singletonThread == null) {
            synchronized (SingletonThread.class) {
                singletonThread = new SingletonThread();
            }
        }
        return singletonThread;
    }
}
